//
//  WFeedbackVC.m
//  Trucks
//
//  Created by enzhoukeji on 2018/7/9.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "WFeedbackVC.h"
#import "UITextView+PlaceHolder.h"
//#import "WFeedBackModel.h"
@interface WFeedbackVC ()
@property(nonatomic,strong)UITextView *textV;
//@property(nonatomic,strong)MineUtils * feedtils;


@end

@implementation WFeedbackVC
//-(MineUtils *)feedtils{
//    if (!_feedtils) {
//        _feedtils=[MineUtils new];
//    }
//    return _feedtils;
//}
-(UITextView *)textV{
    if (!_textV) {
        _textV=[UITextView new];
        _textV.tintColor=[AppStyleConfiguration ColorWithTextOne];
        _textV.textColor=[AppStyleConfiguration ColorWithTextOne];
        _textV.font=[AppStyleConfiguration appFont:16];
        _textV.layer.borderWidth =.5;
        [_textV addPlaceHolder:@"亲，请输入你的宝贵意见！"];
        _textV.frame=CGRectMake(30, 10, kMainScreen_width-60, 230);
    }
    return _textV;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle=@"意见反馈";
    self.navRightBtnTitle=@"提交";
    self.view.backgroundColor=[AppStyleConfiguration ColorWithBaseBoard];
    [self.navRightBtn setTitleColor:[AppStyleConfiguration ColorWithTextOne] forState:UIControlStateNormal];
    [self addTextView];
}
//-(void)createData {
//    if ([self.textV.text isEqualToString:@""]) {
//        [SVProgressHUD showErrorWithStatus:@"请输入意见"];
//    }else{
//        self.feedtils.message = self.textV.text;
//        [self.feedtils updateFeedBackData:^(id requestDic) {
//            if ([requestDic[@"Truck"][@"Head"][@"state"] isEqualToString:@"error"]) {
//                [ SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"%@",requestDic[@"Truck"][@"Head"][@"msg"]]];
//            }
//            if ([requestDic[@"Truck"][@"Head"][@"state"] isEqualToString:@"succ"]) {
//                [ SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"%@",requestDic[@"Truck"][@"Head"][@"msg"]]];
//                self.textV.text = @"";
//                [self.textV addPlaceHolder:@"亲，请输入你的宝贵意见！"];
//                [self.navigationController popViewControllerAnimated:YES];
//
//            }
//        } failure:^(NSError *error) {
//
//        }];
//    }
//}
-(void)addTextView{
    UIView *ve=[[UIView alloc]initWithFrame:CGRectMake(0, 20+kMainTopHeight, kMainScreen_width, 240)];
    //    ve.backgroundColor=[UIColor whiteColor];
    [ve addSubview:self.textV];
    [self.view addSubview:ve];
    UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(kMainScreen_width - 110, ve.bottom + 20, 80, 30)];
    button.backgroundColor = [UIColor colorWithRed:0.56 green:0.59 blue:0.78 alpha:1.00];
    [button setTitle:@"提交" forState:UIControlStateNormal];
    button.layer.cornerRadius = 15;
    [button addTarget:self action:@selector(submitButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
}
-(void)submitButton:(UIButton *)btn {
//    [self createData];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//-(void)viewWillAppear:(BOOL)animated
//{
//    [super viewWillAppear:animated];
//    [self createData];
//}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
